package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import com.sky.result.PageResult;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface CategoryMapper {
    //分页查询
    Page<Category> list(String name ,Integer type);
    // 修改分类
    @AutoFill(OperationType.UPDATE)
    void updateCategory(Category category );
    //新增分类
    @AutoFill(OperationType.INSERT)
    void insertCategory(Category category);
    //根据id删除分类
    @Delete("Delete from category where id=#{id}")
    void deleteCategory(Long id);

    List<Category> getList(Integer type);

}
